﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Sega_Dama_3D
{
    static class SoundManager
    {
        private static Dictionary<String, Song> _musicas = new Dictionary<String, Song>();
        private static Dictionary<String, SoundEffect> _efeitos = new Dictionary<String, SoundEffect>();

        public static float volumeMusicas = 0.3f;
        public static float volumeEfeitos = 0.5f;


        public static void AddMusic(String name, Song song)
        {
            _musicas.Add(name, song);
        }

        public static void PlayMusic(String name)
        {
            MediaPlayer.Volume = volumeMusicas;
            MediaPlayer.Play(_musicas[name]);
        }

        public static void AddSoundEffect(String name, SoundEffect soundEffect)
        {
            _efeitos.Add(name, soundEffect);
        }

        public static void PlaySoundEffect(String name)
        {
            SoundEffectInstance instancia;

            instancia = _efeitos[name].CreateInstance();
            instancia.Volume = volumeEfeitos;
            instancia.Play();
        }










    }
}
